package com.wallj.livechatclient;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

/**
 * 描述：
 *
 * @author walljiang
 * @since 2016/06/24 15:34
 */
public class ConnectDialog extends Dialog {
    EditText etIP, etPort;
    Button btn_connect;
    View.OnClickListener listener;

    public ConnectDialog(Context context, View.OnClickListener listener) {
        super(context);
        this.listener = listener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_connect);
        etIP = (EditText) findViewById(R.id.et_ip);
        etPort = (EditText) findViewById(R.id.et_port);
        btn_connect = (Button) findViewById(R.id.btn_connect);
        btn_connect.setOnClickListener(listener);
    }

    public String getIp() {
        return etIP.getText().toString();
    }

    public String getPort() {
        return etPort.getText().toString();
    }
}
